<meta charset="utf-8">
<div class="box box-primary" id="cloudMember_add" style="max-width: 1200px;">
	<form role="form"  id="editForm" class="form-horizontal" >
			<div class="form-group">
				<label for="userLogo"  class="col-sm-2 control-label" >头像</label>
				<div class="col-md-10">
					<div id="uploader-demo" class="form-group">
						<div id="fileList" class="uploader-list"></div>
					</div>
				</div>
				<div class="col-md-10">
					<img alt="" src="" width="90" height="60" id="userLogo">
				</div>
			</div>
		</div>
		<div class="box-footer">
			<button type="button" class="btn btn-default" v-on:click="cancle">取消</button>
			<button type="button" class="btn btn-info pull-right"  v-on:click="add">提交</button>
		</div>
	</form>
	<script type="text/javascript">

        var uploader ;
        $(function(){
            uploader = WebUploader.create({
                auto: true,
                swf:   '/static/lib/webuploader/Uploader.swf',
                server: '',
                pick: '#filePicker',
                accept: {
                    title: 'Images',
                    extensions: 'gif,jpg,jpeg,bmp,png',
                    mimeTypes: 'image/*'
                }
            }).on( 'uploadSuccess', function( data , response) {
                vm.$data.cloudMember.Logo=response.data.image;
                $("#userLogo").attr("src",response.data.image);
            }).on( 'uploadError', function( file , response) {
                alertSwal.warningText(response.data.message);
            });
        });


        var news= new Vue({
            el: '#cloudMember_add',
            data: {
                cloudMember:{
                 id: undefined,
                 userLogo: undefined
                },
                bus:new Vue(),
            },
            mounted:function(){
            	var _this=this;
				var param=zfesLayerEditDg.getLayerParam();//id
				 _this.cloudMember.id=param.id;
            },
            methods: {
                add: function () {
                    if($("#editForm").valid()){
                        var _this=this;
                        var url="/pmp/service/pub/pmpCloudMember/setUserLogo";
                        zfesAjax.ajaxTodo(url,_this.$data.cloudMember, function(data){
                            alertSwal.successText(data.message);
                            layer.close(layer.index);
                        })
                    }
                },
                cancle:function(){
                    layer.close(layer.index);
                }
            }
        });
	</script>
</div>
